<%@ page contentType="text/html; charset=UTF-8" errorPage="/WEB-INF/adm/pages/jspError.jsp"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<div>
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="30" background="../private/admin_images/tab_05.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="12" height="30"><img src="../private/admin_images/tab_03.gif" width="12" height="30" /></td>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="46%" valign="middle"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="5%"><div align="center"><img src="../private/admin_images/tb.gif" width="16" height="16" /></div></td>
                <td width="95%" align="left"><span class="font3_12px">你当前的位置</span>：[游戏奖金设置]-[游戏奖金模版初始化]</td>
              </tr>
            </table></td>
            <td width="54%"><table border="0" align="right" cellpadding="0" cellspacing="0">
              <tr>
                <td width="60"><table width="87%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td><div align="center">
                      <input type="checkbox" name="checkbox62" value="checkbox" />
                    </div></td>
                    <td><div align="center">全选</div></td>
                  </tr>
                </table></td>
                <td width="60"><table width="90%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td><div align="center"><img src="../private/admin_images/22.gif" width="14" height="14" /></div></td>
                    <td><div align="center">新增</div></td>
                  </tr>
                </table></td>
                <td width="60"><table width="90%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td><div align="center"><img src="../private/admin_images/33.gif" width="14" height="14" /></div></td>
                    <td><div align="center">修改</div></td>
                  </tr>
                </table></td>
                <td width="52"><table width="88%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td><div align="center"><img src="../private/admin_images/11.gif" width="14" height="14" /></div></td>
                    <td><div align="center">删除</div></td>
                  </tr>
                </table></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
        <td width="16"><img src="../private/admin_images/tab_07.gif" width="16" height="30" /></td>
      </tr>
    </table></td>
  </tr>
  
  <tr>
  	<td >
  	
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
  			<tr>
  				<td width="8" background="../private/admin_images/tab_12.gif">&nbsp;</td>
  				
  				<td>
  					<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
  						<tr>
  							<td height="100" colspan="2"><b>游  戏  奖  金  模  版  初  始  化</b></td>
  						</tr>
  						<tr>
  							<td height="25" align="right" width="45%" ><font color="red" >*</font>&nbsp;&nbsp;奖&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;金：</td>
  							<td align="left"><input type="text" id="bonus_input" name="bonus_input" size="20" style="border:1px solid #999999;"/>&nbsp;元</td>
  						</tr>
  						<tr>
  							<td height="25" align="right"><font color="red" >*</font>&nbsp;&nbsp;最高奖金：</td>
  							<td align="left"><input type="text" id="maxBonus_input" name="maxBonus_input" size="20" style="border:1px solid #999999;"/>&nbsp;元</td>
  						</tr>
  						<tr>
  							<td height="25" align="right"><font color="red" >*</font>&nbsp;&nbsp;返&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;点：</td>
  							<td align="left"><input type="text" id="returnPos_input" name="returnPos_input" size="20" style="border:1px solid #999999;"/>&nbsp;%&nbsp;<font color="red" >(0~100的数)</font></td>
  						</tr>
  						<tr>
  							<td height="30" colspan="2">&nbsp;</td>
  						</tr>
  						<tr>
  							<td height="50" colspan="2">
  								<input type="button" id="saveButton" name="saveButton" value="游戏奖金模版初始化" onclick="return initialTemplate();"/>
  							</td>
  						</tr>
  						<tr>
  							<td height="50" colspan="2">
  							</td>
  						</tr>
  					</table>
  				</td>
  				
  				<td width="8" background="../private/admin_images/tab_15.gif" align="right">&nbsp;</td>
  			</tr>
  		</table>
	
  	</td>
  </tr>
  
  <tr>
    <td height="35" background="../private/admin_images/tab_19.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="12" height="35"><img src="../private/admin_images/tab_18.gif" width="12" height="35" /></td>
        <td align="left"><font color="red">&nbsp;*&nbsp;</font>温馨提示：建议系统第一次运行初始化后不再进行初始化，如需修改可到游戏奖金设置功能中进行设置。</td>
        <td width="16"><img src="../private/admin_images/tab_20.gif" width="16" height="35" /></td>
      </tr>
    </table></td>
  </tr>
</table>
</div>
<html:form action="/adm/initialBonus" method="post">
	<html:hidden property="bonus" />
	<html:hidden property="maxBonus" />
	<html:hidden property="returnPos" />
	<html:hidden property="operator" />
</html:form>
<script type="text/javascript">
<!--
function isDecimal(s){
	var pattern = new RegExp(/^([0-9]+(\.?))?[0-9]+$/);
	return pattern.test(s);
}
function initialTemplate(){
	var bonus = document.getElementById("bonus_input").value;
	var maxBonus = document.getElementById("maxBonus_input").value;
	var returnPos = document.getElementById("returnPos_input").value;
	if(bonus == ""){
		alert("请输入奖金数额！");
		document.all.bonus_input.focus();
		return false;
	}
	if(!isDecimal(bonus)){
		alert("奖金数额必须为正数！");
		document.all.bonus_input.focus();
		return false;
	}
	if(maxBonus == ""){
		alert("请输入最高奖金数额！");
		document.all.maxBonus_input.focus();
		return false;
	}
	if(!isDecimal(maxBonus)){
		alert("最高奖金数额必须为正数！");
		document.all.maxBonus_input.focus();
		return false;
	}
	if(returnPos == ""){
		alert("请输入返点！");
		document.all.returnPos_input.focus();
		return false;
	}
	if(!isDecimal(returnPos) || parseFloat(returnPos) < 0 || parseFloat(returnPos) > 100){
		alert("返点必须为0~100之间正数！");
		document.all.returnPos_input.focus();
		return false;
	}
	document.all.bonus.value = document.getElementById("bonus_input").value;
	document.all.maxBonus.value = document.getElementById("maxBonus_input").value;
	document.all.returnPos.value = document.getElementById("returnPos_input").value;
	document.all.operator.value = "1";
	document.all.ADMBonusForm.submit();
	document.all.saveButton.value = "正在初始化数据，请稍后....";
	document.all.saveButton.disabled = true;
	document.all.bonus_input.disabled = true;
	document.all.maxBonus_input.disabled = true;
	document.all.returnPos_input.disabled = true;
	return true;
}
//-->
</script>